<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">
<head>
<base href="<?php echo Yii::app()->request->baseUrl; ?>/static/admincp/" />
<meta http-equiv="cache-control" content="public" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="en-US,vi" />
<title>Admin Control Panel</title>
<link rel="stylesheet" type="text/css" href="<?php echo MINIFY_URL; ?>?g=admincp_css" media="screen" />
<script type="text/javascript" src="<?php echo MINIFY_URL; ?>?g=admincp_js"></script>
<script type="text/javascript">
var DOMAIN = 'http://<?php echo DOMAIN; ?>';
$(function(){
	//$(".box .h_title").not(this).next("ul").hide("normal");
	$(".box .h_title").not(this).next("#home").show("normal");
	$(".box").children(".h_title").click( function() { $(this).next("ul").slideToggle(); });
});
</script>
</head>
<body>
<div class="wrap">
	<div id="header">
		<div id="top">
			<div class="left">
				<p><?php echo Yii::t('AdmincpModule.admincp', 'Welcome')?>, <strong><?php echo Yii::app()->admin->name; ?></strong> [ <a href="<?php echo Yii::app()->baseUrl.'/admincp/auth/logout' ?>"><?php echo Yii::t('AdmincpModule.admincp', 'Logout')?></a> ]</p>
			</div>
			<div class="right">
				<div class="align-right">
					<p>Last login: <strong><?php echo Yii::app()->admin->getState('last_login'); ?></strong></p>
				</div>
			</div>
		</div>
		<div id="nav">
			<ul>
				<li><a href="<?php echo Yii::app()->request->baseUrl; ?>/admincp">Main control</a>
					<ul>
						<li>&#8250; <a href="<?php echo Yii::app()->request->baseUrl; ?>">Visit site</a></li>
                        <li>&#8250; <a href="<?php echo LINK_ADMINCP_SYSTEM; ?>">System Information</a></li>
					</ul>
				</li>
                <?php if(Yii::app()->admin->hasPermission('manage posts') || Yii::app()->admin->hasPermission('manage categories') || Yii::app()->admin->hasPermission('manage media')): ?>
				<li><a href="javascript:void(0);">Manage content</a>
					<ul>
                		<?php if(Yii::app()->admin->hasPermission('manage posts')):
								$arrTaxonomies = Taxonomies::getInstance()->getList();
								foreach($arrTaxonomies as $R):
						?>
                        <li>&#8250; <a href="<?php echo LINK_ADMINCP_POSTS.'/'.$R['taxonomy_code']; ?>"><?php echo $R['taxonomy_name'];?></a></li>
						<?php endforeach; endif; ?>
						<?php if(Yii::app()->admin->hasPermission('manage categories')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_CATEGORIES; ?>">Categories</a></li><?php endif; ?>
						<?php if(Yii::app()->admin->hasPermission('manage media')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_MEDIA; ?>">Media</a></li><?php endif; ?>
						<?php if(true || Yii::app()->admin->hasPermission('manage taxonomies')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_TAXONOMIES; ?>">Taxonomies</a></li><?php endif; ?>
                    </ul>
				</li>
                <?php endif; ?>
                <?php if(Yii::app()->admin->hasPermission('manage menu') || Yii::app()->admin->hasPermission('manage email templates') || Yii::app()->admin->hasPermission('manage subscribers')): ?>             
                <li><a href="javascript:void(0);">Management</a>
					<ul>
						<?php if(Yii::app()->admin->hasPermission('manage menu')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_MENU; ?>">Menu</a></li><?php endif; ?>
						<?php if(Yii::app()->admin->hasPermission('manage email templates')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_EMAILTEMPLATES; ?>">Email template</a></li><?php endif; ?>
                        <!--<li>&#8250; <a href="<?php echo LINK_ADMINCP_LANGUAGES; ?>">Languages</a></li>-->
                        <?php if(Yii::app()->admin->hasPermission('manage subscribers')): ?>
                        <li>&#8250; <a href="javascript:void(0);">Subscriptions</a>
                        	<ul>
                            	<li><a href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS; ?>/subscribers">Subscribers</a></li>
                                <li><a href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS; ?>/lists">Mailing Lists</a></li>
                                <li><a href="<?php echo LINK_ADMINCP_SUBSCRIPTIONS; ?>/emails">Email Subscriptions</a></li>
                            </ul>
                        </li>
						<?php endif; ?>
						<?php if(Yii::app()->admin->hasPermission('manage feedback')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_FEEDBACK; ?>">Feedback</a></li><?php endif; ?>
                    </ul>
				</li>
                <?php endif; ?>
                <?php if(Yii::app()->admin->hasPermission('manage roles')): ?>
				<li><a href="<?php echo LINK_ADMINCP_USERS; ?>">Users</a>
					<ul>
						<?php if(Yii::app()->admin->hasPermission('manage users')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_USERS; ?>">Uses</a></li><?php endif; ?>
						<?php if(Yii::app()->admin->hasPermission('manage roles')): ?><li>&#8250; <a href="<?php echo LINK_ADMINCP_ROLES; ?>">Roles</a></li><?php endif; ?>
					</ul>
				</li>
                <?php endif; ?>
				<li><a href="<?php echo LINK_ADMINCP_CUSTOMCONFIGS; ?>">Settings</a>
					<ul>
                    	<?php if(Yii::app()->admin->hasPermission('manage settings')):
								$arrGroups = Settings::getInstance()->getListGroups();
								foreach($arrGroups as $R):
						?>
                        <li>&#8250; <a href="<?php echo LINK_ADMINCP_CUSTOMCONFIGS.'/?type='.$R['setting_group']; ?>"><?php echo ucfirst($R['setting_group']);?></a></li>
						<?php endforeach; endif; ?>
						<li>&#8250; <a href="<?php echo LINK_ADMINCP_USERS; ?>/changepassword">Change password</a></li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
	
	<div id="content">
		<div id="sidebar">
			<!--<div class="box">
				<div class="h_title">&#8250; Main control</div>
				<ul id="home">
					<li class="b1"><a class="icon view_page" href="">Visit site</a></li>
					<li class="b2"><a class="icon report" href="">Reports</a></li>
					<li class="b1"><a class="icon add_page" href="">Add new page</a></li>
					<li class="b2"><a class="icon config" href="">Site config</a></li>
				</ul>
			</div>-->
			<?php if(Yii::app()->admin->hasPermission('manage posts') || Yii::app()->admin->hasPermission('manage categories') || Yii::app()->admin->hasPermission('manage media')): ?>
			<div class="box">
				<div class="h_title">&#8250; Manage content</div>
				<ul>
                	<?php if(Yii::app()->admin->hasPermission('manage posts')):
							$arrTaxonomies = Taxonomies::getInstance()->getList();
							foreach($arrTaxonomies as $R):
					?>
					<li class="b1"><a class="icon page"  href="<?php echo LINK_ADMINCP_POSTS.'/'.$R['taxonomy_code']; ?>"><?php echo $R['taxonomy_name'];?></a></li>
					<?php endforeach; endif; ?>
					<li class="b1"><a class="icon category" href="<?php echo LINK_ADMINCP_CATEGORIES; ?>">Categories</a></li>
					<li class="b1"><a class="icon photo" href="<?php echo LINK_ADMINCP_MEDIA; ?>">Media</a></li>
				</ul>
			</div>
            <?php endif; ?>
            <?php if(Yii::app()->admin->hasPermission('manage advertisements') || Yii::app()->admin->hasPermission('manage roles')): ?>
			<div class="box">
				<div class="h_title">&#8250; Manage users</div>
				<ul>
					<li class="b1"><a class="icon users" href="<?php echo LINK_ADMINCP_USERS; ?>">Users</a></li>
					<li class="b1"><a class="icon add_user" href="<?php echo LINK_ADMINCP_ROLES; ?>">Roles</a></li>
				</ul>
			</div>
            <?php endif; ?>
			<div class="box">
				<div class="h_title">&#8250; Settings</div>
				<ul>
					<?php if(Yii::app()->admin->hasPermission('manage settings')): ?><li class="b1"><a class="icon config" href="<?php echo LINK_ADMINCP_CUSTOMCONFIGS; ?>">Site configuration</a></li><?php endif; ?>
                    <?php if(Yii::app()->admin->hasPermission('manage feedback')): ?><li class="b1">&#8250; <a class="icon contact" href="<?php echo LINK_ADMINCP_FEEDBACK; ?>">Feedback</a></li><?php endif; ?>
					<li class="b1"><a href="<?php echo LINK_ADMINCP_USERS; ?>/changepassword">Change password</a></li>
                </ul>
			</div>
		</div>
		<div id="main">
			<?php echo $content; ?>
		</div>
		<div class="clear"></div>
	</div>

	<div id="footer">
		<div class="left">
			<p>Admin Panel: <a href="<?php echo Yii::app()->request->baseUrl; ?>"><?php echo Yii::app()->request->baseUrl; ?></a></p>
		</div>
		<div class="right">
			<p><a href="javascript:void(0);">Help</a> | <a href="javascript:void(0);">Webmaster</a></p>
		</div>
	</div>
</div>

</body>
</html>